<?php
//inculde即可以使用data数据。本页所有的data数据，倾在controller都处理好
include_once("../../../common/module/checkA.php");
include_once("../../../../config.php");
include_once("../controller/detail-list.php");

?>


<?
//用来判断当前系统属于什么板块
$system_part = $_REQUEST['now_extender'];
$detail=select_one_line_all_items($table_prefix."product","nid = '".$_REQUEST['nid']."'");
$category_list=select_lines_all_items($table_prefix."term","listorder desc , nid desc","interm = 'root' and belong = 'product' ","")


?>


<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
    "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>

    <? include_once(ROOT_PATH_ . "/controller/common/module/head.php"); ?>

</head>

<body>

<div id="topbar">
    <?php include ROOT_PATH_ . '/controller/common/module/topbar.php'; ?>
</div>

<div id="container" class="<? echo $system_part ?>">

    <div id="maincontent">

        <div id="sidebar">
            <?php include ROOT_PATH_ . '/controller/common/module/sidebar.php'; ?>
        </div>




        <div id="content">
            <?php $page_title = '修改 '.$detail['name'].' 信息'; ?>
            <?php include ROOT_PATH_ . '/controller/common/module/mod-page-title.php'; ?>


            <div class="detail-box member-edit-box layui-form">

<div class="detail-boxes">
<ul class="detail-boxing">

<?
$nowpageid = $_GET["nowpageid"];
?>

<form id="edit-form" enctype="multipart/form-data" method="post" action="detail-edit-function.php?nav-itemed=product&now_extender=product&nowpageid=<?echo $nowpageid?>" enctype="multipart/form-data" class="layui-form">


 <input type="hidden" name="nid" value="<? echo $detail['nid']?>">


    <div class="layui-form-item">
    <label class="layui-form-label">商品名字</label>
        <div class="layui-input-block">
          <input type="text" name="ai_name" required  lay-verify="required"
                 placeholder="请输入商品名字" autocomplete="off" class="layui-input" value="<? echo $detail['name']?>">
        </div>
  	</div>


    <div class="layui-form-item">
        <label class="layui-form-label">产品型号</label>
        <div class="layui-input-block">
            <input type="text" name="ai_model"
                   placeholder="请输入商品名字" autocomplete="off" class="layui-input" value="<? echo $detail['model']?>">
        </div>
    </div>



    <div class="layui-form-item">
         <label class="layui-form-label">商品分类</label>
         <div class="layui-input-block">
              <select name="ai_cat_id">
                  <option value="" >请选择</option>
                  <?php


				  foreach($category_list as $k=>$val){

					if($val['nid'] === $detail['cat_id'])
                    {

						$select = 'selected="selected"';
					}
                      else
                      {$select = '';}

					echo '<option value="'.$val['nid'].'"  '.$select.' >'.$val['name'].'</option>';
				  }
				  ?>

              </select>
          </div>
    </div>

    <div class="layui-form-item">
          <label class="layui-form-label">商品价格</label>
          <div class="layui-input-block">
             <input type="text" name="ai_price" class="layui-input" required  lay-verify="required"
                    placeholder="请输入价格" autocomplete="off" value="<? echo $detail['price']?>"/>
          </div>
    </div>






    <div class="layui-form-item">
        <label class="layui-form-label">排序</label>
        <div class="layui-input-block">
            <input type="text" name="ai_listorder"
                   placeholder="" autocomplete="off" class="layui-input" value="<? echo $detail['listorder']?>">
        </div>
    </div>





    <? include("mod-images-upload.php");?>

    <div class="layui-form-item">
        <label class="layui-form-label">是否显示</label>
        <div class="layui-input-block">
            <input type="radio" name="ai_publish" value="0" title="隐藏"
                <? if($detail['publish']=="0"){echo "checked";} ?>
                >
            <input type="radio" name="ai_publish" value="1" title="显示"
                <? if($detail['publish']=="1"){echo "checked";} ?>
                >

        </div>
    </div>

  <div class="function">
    <div class="layui-input-block">
      <button class="layui-btn" lay-submit  type="submit">立即提交</button>
      <button type="reset" class="layui-btn layui-btn-primary">重置</button>
    </div>
  </div>



<input name="now_extender" type="hidden" value="<? echo $_REQUEST['now_extender'] ?>"/>
<input name="nowpageid" type="hidden" value="<? echo $_REQUEST['nowpageid'] ?>"/>
<input name="sortby" type="hidden" value="<? echo $_REQUEST['sortby'] ?>"/>



</form>

</ul>
</div>
</div>

<!--content端點01-->
</div>
<!--maincontent端點01-->
<br class="clearfloat"/>
</div>
<!--container端點01-->
</div>


<?php include ROOT_PATH_ . "/controller/common/module/footer.php"; ?> </body>
</html>
